package com.ice.work.moment.facade.user.controller.role;

import com.honeybee.cloud.framework.common.page.Page;
import com.honeybee.cloud.framework.common.response.ResponseEntity;
import com.ice.work.moment.facade.user.request.PageRoleRequest;
import com.ice.work.moment.facade.user.vo.RoleVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @Description 角色controller
 * @Author DELL
 * @Create 2019-02-11
 * @Since 1.0.0
 */
@FeignClient(value = "moment-role", fallbackFactory = RoleHystrixFallbackFactory.class)
public interface IRoleController {

    /**
     * 查询角色列表
     * @param request
     * @param page
     * @param size
     * @return
     */
    @PostMapping(value = "/role-page", name = "查询角色列表")
    @PreAuthorize("hasAuthority('ROLE-0001')")
    ResponseEntity<Page<RoleVO>> pageRole(@RequestBody @Validated PageRoleRequest request, @RequestParam("page") Long page, @RequestParam("size") Long size);


}
